/*
 * @Author: your name
 * @Date: 2022-04-12 10:35:29
 * @LastEditTime: 2022-04-20 13:09:48
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \trace-source-web\src\api\production-api\index-primary.js
 */
import xjaxios from "@/api/axios";
// let organizationNo = sessionStorage.getItem('organizationNo');

export default {
  /**
     * @description: 获取角色所拥有的功能权限
     * @param {String} userId
     * @param {String} system
     * @return {Object}
     */
  //  产量信息
  queryReportForm(params) {
    return xjaxios.post("trace/partYield/queryReportForm", params);
  },
  // 病虫害信息
  queryDataByBatchFrom(params) {
    return xjaxios.post("trace/queryDataByBatchNo", params);
  },
  // 病虫害详细信息
  queryDataByInsectName(params) {
    return xjaxios.post("insectSituation/insectCollection/queryDataByInsectName", params);
  },
  // 生长图片信息
  findGrowthAll(params) {
    return xjaxios.post("trace/growthRecord/queryGrowthRecordPage", params);
  },
  // 生长环境信息
  getEnvironmentItems(params) {
    return xjaxios.post("trace/growthRecord/getEnvironmentByBatchNoAndTime", params);
  },
  // 生长环境详情
  getEnvironmentCalendarItemList(params) {
    return xjaxios.post(`trace/growthRecord/getEnvironmentItemList`, params);
  },
  // 生长环境详情
  getEnvironmentItemList(id, params) {
    return xjaxios.post(`trace/growthRecord/getEnvironmentItemList?dataItemId=${id}`, params);
  },
  // 产品信息
  queryTraceForScanCode(params) {
    return xjaxios.post("trace/traceSource/queryTraceForScanCode", params);
  },
  // 农资投入详情
  agriculturalInputs(params) {
    return xjaxios.post("trace/agriculturalInputs/queryByCondition", params);
  },
  // 农资投入总数
  agriculturalInputsTime(params) {
    return xjaxios.post("trace/agriculturalInputs/queryByTime", params);
  },
  farmingOperationPage(params) {
    return xjaxios.post("trace/agriculturalInputs/queryPageList", params);
  },
  // 农事总数
  farmingOperation(params) {
    return xjaxios.post("trace/farmingOperation/queryByTime", params);
  },
  // 农事总数
  farmingminOperation(params) {
    return xjaxios.post("trace/farmingOperation/queryByCondition", params);
  },
  // 农事分页
  farmingminOperationyPage(params) {
    return xjaxios.post("trace/farmingOperation/queryPageList", params);
  },
  // 获取资质轮播图
  feignInfo(params) {
    return xjaxios.post("organization/businessImg/queryByCondition", params);
    // return xjaxios.post("trace/feignInfo/queryByCondition", params);
  },
  // 获取生长图片详细信息·
  getEnvironmentItemByGrowthRecordId(nowbatchNo) {
    return xjaxios.get(`trace/growthRecord/getEnvironmentDataItemByGrowthRecordNo?growthRecordNo=${nowbatchNo}`);
  },
  // 获取图片
  tracePicture(nowbatchNo) {
    return xjaxios.get(`trace/tracePicture/query?batchNo=${nowbatchNo}`);
  },
  // 获取年份月份
  queryMonth(nowbatchNo) {
    return xjaxios.get(`trace/queryMonth?batchNo=${nowbatchNo}`);
  },
  // -----------------------------------------------------------------
  // 日历
  getCalendarEventsApi(params) {
    return xjaxios.post("trace/growthRecord/getCalendar", params);
  },
  // 获取检测报告
  getDetectionReport(nowbatchNo) {
    return xjaxios.get(`trace/detectionReport/getDetectionReport?batchNo=${nowbatchNo}`);
  },
  // 获取溯源码图片
  // 日历
  traceCodeImage(params) {
    return xjaxios.post("/sheepTrace/underlay/queryByCondition", { organizationNo: params });
  },
  traceCodeImageAdd(params) {
    console.log(params);
    return xjaxios.post("/sheepTrace/underlay/add", { ...params });
  }

}
